Converting Static Data into SQL Data

Description

Static List Control data can be converted to a SQL data source using the "Convert Data Source to SQL Database" tool.

  1. In the UX Builder on the UX Controls page, open the Data Controls menu and click on the [List] option to add a list control to the component.

    images/stasql.png
  2. Highlight the added list control. In the control's properties list, in the List Properties section, click on the button next to the List properties property to open the List Builder.

    images/stasql2.png
  3. In the Data Source pane select 'Static' from the Data Source Type menu.

    images/stasql3.png
  4. Click the button next to the Static data property to open the 'Static Choices' dialog.

    images/stasql4.png
  5. Click on the 'Sample data'' button in the lower corner of the dialog.

    images/stasql5.png
  6. From the available sample data select the 'Name and addresses (big data set)' option and click OK and OK again.

    images/stasql6.png
  7. Back on the Data Source pane, go to the Return Value section and click the button next to the Return field property.

    images/stasql7.png
  8. Set the return field to one of the fields in the static data, in this case the ContactName field. Click OK

    images/stasql8.png
  9. In the "Convert Data Source to SQL Database" section click on the button next to the 'Convert List data source to SQL database' property.

    images/stasql9.png
  10. In the Convert Data Source Type genie click the button next to the Connection string property.

    images/stasql10.png
  11. If you already have a connection to the Northwind database, choose the 'Use a named connection string' radio button, click the Select button, and select the Northwind database connection. Otherwise check the 'Specify a connection string' option and define a connection to the Microsoft Northwind database. Close the Connection String Genie

    images/stasql11.png
  12. Still in the 'Convert Data Source Type' genie select 'New Table' from the dropdown options.

    images/stasql12.png
  13. In the New table name property give the table a name by typing it into the textbox. and click OK.

    images/stasql13.png
  14. Click the button next to the 'Map fields in the List to columns in the SQL table' property.

    images/stasql14.png
  15. View the Table Structure, then Click OK.

    images/stasql15.png
  16. On the Data Source pane the data should now appear as SQL in the Data Source Type menu.

    images/stasql16.png
  17. Open the List Layout pane in the List Builder. Use the blue > arrow to move some fields from the Available Fields list into the Columns in List. Click OK to close the List Builder

    images/stasql17.png
  18. Run the Component in the Live Preview.

    images/stasql18.png
    Static data converted to SQL data displayed in a list control

When you create a new component you should see the table you defined appear in the Northwind database alongside the other built-in tables. For an example of a good place to make use of this data see the afterRefreshListIncremental Event page.

See Also